package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
        BookLibrary bookLibrary = new BookLibrary(bufferRead);
        MovieLibrary movieLibrary = new MovieLibrary(bufferRead);
        Session session = new Session(bufferRead);
        LibraryService bookService = new LibraryService(bufferRead, bookLibrary, movieLibrary, session);


        System.out.println("Welcome to Biblioteca!");
        if (session.login()) {
            while (!bookService.stop) {
                Welcome();
                bookService.execute();
            }
        }
    }

    private static void Welcome() {
        System.out.println("Please select an option: ");
        System.out.println("list books");
        System.out.println("checkout book");
        System.out.println("return book");
        System.out.println("list movies");
        System.out.println("checkout movie");
        System.out.println("return movie");
        System.out.println("login");
    }
}
